package ihm;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JSpinner;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Liste_NumerosDansSpectacle extends JFrame implements ActionListener {

	private JPanel contentPane;
	private JLabel lblListerLesNumros;
	private JLabel lblSpectacle;
	private JComboBox cbxSpec;
	private JLabel lblNumro;
	private final JList list = new JList();
	private JButton btnAnnuler;
	private JButton btnValider;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Liste_NumerosDansSpectacle frame = new Liste_NumerosDansSpectacle();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Liste_NumerosDansSpectacle() {
		setTitle("Lister les num\u00E9ros d'un spectacle");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		lblListerLesNumros = new JLabel("Lister les num\u00E9ros d'un spectacle");
		lblListerLesNumros.setFont(new Font("Times New Roman", Font.BOLD | Font.ITALIC, 14));
		lblListerLesNumros.setBounds(98, 24, 203, 29);
		contentPane.add(lblListerLesNumros);
		
		lblSpectacle = new JLabel("Spectacle :");
		lblSpectacle.setBounds(0, 73, 67, 14);
		contentPane.add(lblSpectacle);
		
		cbxSpec = new JComboBox();
		cbxSpec.setBounds(71, 69, 116, 22);
		contentPane.add(cbxSpec);
		
		lblNumro = new JLabel("Num\u00E9ros :");
		lblNumro.setBounds(193, 73, 56, 14);
		contentPane.add(lblNumro);
		list.setBounds(250, 72, 155, 138);
		contentPane.add(list);
		
		btnAnnuler = new JButton("Annuler");
		btnAnnuler.addActionListener(this);
		btnAnnuler.setBounds(311, 228, 91, 23);
		contentPane.add(btnAnnuler);
		
		btnValider = new JButton("Valider");
		btnValider.setBounds(194, 228, 91, 23);
		contentPane.add(btnValider);
	}
	
	public void actionPerformed(ActionEvent e) 
	{
		if (e.getSource() == btnAnnuler)
		{
			dispose();
		}
	}
}
